package nuc.jyg.controller;

import nuc.jyg.bean.User;
import nuc.jyg.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @Author Nuc YongGuang Ji
 * Created by JiYongGuang on 2017/5/17.
 */
@Controller
public class UserController {

    @Autowired
    UserService userService;

    @RequestMapping(value = "/user")
    public String saveUser(@RequestBody @ModelAttribute User user) {
        System.out.println(user);
        userService.save(user);
        return "hello";
    }
}
